-
Notifications
You must be signed in to change notification settings - Fork 1.2k
chore(deps): remove dependency on github.com/pkg/errors #2184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the dependency on github.com/pkg/errors and updates error creation and wrapping accordingly throughout the codebase. Key changes include replacing errors.Errorf and errors.Wrapf with fmt.Errorf and errors.New, and removing the import of github.com/pkg/errors.
Reviewed Changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
value.go | Replaced pkg/errors usage with built-in errors and fmt.Errorf |
util.go | Removed pkg/errors import; minor update to error handling |
txn.go | Updated error formatting and removed pkg/errors import |
trie/trie.go | Updated error wrapping for ignore bytes parsing |
table/table.go | Switched to using errors and fmt.Errorf instead of pkg/errors |
table/builder.go | Removed pkg/errors import and updated corresponding error handling |
stream_writer.go | Updated error wrapping in flatten and key order checks |
publisher_test.go | Removed pkg/errors import in tests |
options.go | Replaced pkg/errors usage with fmt.Errorf in compression parsing |
memtable.go | Updated error message in file existence check |
manifest.go | Removed pkg/errors import; updated error creation for magic/checksum errors |
levels.go | Replaced pkg/errors usage with errors.New in table-filling error |
db.go | Updated error messages and error wrapping across various checks |
batch.go | Replaced pkg/errors usage with fmt.Errorf in batch flushing errors |
badger/cmd/stream.go | Removed pkg/errors import; updated error creation for CLI validations |
badger/cmd/read_bench.go | Removed pkg/errors import; updated error creation in test logic |
badger/cmd/info.go | Removed pkg/errors import; updated error message formatting |
badger/cmd/flatten.go | Removed pkg/errors import; updated error creation for compression checks |
backup.go | Switched pkg/errors usage to fmt.Errorf for error wrapping in backup logic |
Files not reviewed (1)
- go.mod: Language not supported
Comments suppressed due to low confidence (1)
db.go:154
- [nitpick] Consider using consistent capitalization for 'ValueThreshold' rather than 'Valuethreshold' in the error message.
return fmt.Errorf("Valuethreshold %d greater than max batch size of %d. Either "+
Thank you for the PR, why does it not remove this package from go.mod? |
Some other dependencies still have it referenced:
Would need to update ristretto when next version is released: hypermodeinc/ristretto@a748a7f as you have renovate set up it would be done some time automatically. |
We should upgrade ristretto to v2.2.0 released here https://github.com/hypermodeinc/ristretto/releases/tag/v2.2.0 |
@mangalaman93 do you want me to do it in this PR? or I can create another one with upgrade, or wait for renovate. I'm not in a rush. |
This PR is fine too |
@mangalaman93 done |
Description
Remove dependency on github.com/pkg/errors as it was archived
Checklist
CHANGELOG.md
file describing and linking tothis PR
staged and linked here
Instructions
syntax, leading with
fix:
,feat:
,chore:
,ci:
, etc.link to the bug.
[x]
syntax.back and check the box later.
Instructions
line and everything below it, to indicate you have read and arefollowing these instructions. 🙂
Thank you for your contribution to Badger!